package com.group3.pojo.receive;

import com.group3.controller.Validated.Add;
import com.group3.controller.Validated.Update;
import com.group3.domain.Klass;
import com.group3.pojo.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.*;


/**
 * KlassReceive
 *
 * @author HY
 * 2021/06/11 16:49
 **/

@Data
@ToString
@ApiModel(value = "班级参数信息")
public class KlassReceive extends Page {

    //TODO 通过注解来进行参数验证实例：
    //其中group参数是指进行分组验证：比如添加和查询所用的都为同一个类，
    // 那么添加的时候参数需要为必须输入，但在查询时却不需要，所以需要分组进行参数验证

    @NotBlank(message = "班级名不能为空", groups = Add.class)
    @NotBlank(message = "班级名不能为空", groups = Update.class)
    @ApiModelProperty(value = "班级名", required = true)
    private String classId = "";

    @NotBlank(message = "班主任教师工号不能为空", groups = Add.class)
    @NotBlank(message = "班主任教师工号不能为空", groups = Update.class)
    @ApiModelProperty(value = "班主任教师工号", required = true)
    private String teacherId = "";

    @NotBlank(message = "年级不能为空", groups = Add.class)
    @NotBlank(message = "年级不能为空", groups = Update.class)
    @ApiModelProperty(value = "年级", required = true)
    private String grade = "";

    @NotBlank(message = "院系不能为空", groups = Add.class)
    @NotBlank(message = "院系不能为空", groups = Update.class)
    @ApiModelProperty(value = "院系", required = true)
    private String departName = "";

    @NotBlank(message = "专业不能为空", groups = Add.class)
    @NotBlank(message = "专业不能为空", groups = Update.class)
    @ApiModelProperty(value = "专业", required = true)
    private String professionName = "";

    @Max(value = 1, message = "是否结业只能为0或1", groups = Add.class)
    @Min(value = 0, message = "是否结业只能为0或1", groups = Add.class)
    @Max(value = 1, message = "是否结业只能为0或1", groups = Update.class)
    @Min(value = 0, message = "是否结业只能为0或1", groups = Update.class)
    @ApiModelProperty(value = "是否结业", required = true)
    private Integer statue = null;

}
